package com.wonder.constant;

import com.vtuzx.core.constant.IVtuzxEnum;

public enum BillType implements IVtuzxEnum<BillType> {
    /** 采购收货 */
    CGSH("CGSH", "101", "采购收货单", 0),
    /** 其他收货单 */
    QTSH("QTSH", "301", "其他收货单", 0),
    /** 车间收货单 */
    CJSH("CJSH", "201", "车间收货单", 0),
    /** 采购入库 */
    CGRK("CGRK", "101", "采购入库单", 1),
    /** 收料通知 */
    SLTZ("SLTZ", "101", "收料通知单", 0),
    /** 订单同步 */
    DDTB("DDTB", "101", "收料通知单", 0),
    /** 生产领料 */
    SCLL("SCLL", "201", "生产领料", -1),
    /** 其他出库 */
    QTCK("QTCK", "301", "其他出库", -1),
    /** 销售出库 */
    XSCK("XSCK", "401", "销售出库", -1),
    /** 其他入库 */
    QTRK("QTRK", "301", "其他入库", 1),
    /** 追溯码 */
    ZSM("ZSM", "", "追溯码", 0),
    /** 调拨出库 */
    DBCK("DBCK", "", "调拨出库", -1),
    /** 调拨入库 */
    DBRK("DBRK", "", "调拨入库", 1),
    /** 采购订单 */
    CGDD("CGDD", "", "采购订单", 0),
    /** 生产任务 */
    SCRW("SCRW", "", "生产任务", 0),
    /** 用料清单 */
    YLQD("YLQD", "", "用料清单", 0),
    /** 生产补料 */
    SCBL("SCBL", "", "生产补料", -1),
    /** 生产退料 */
    SCTL("SCTL", "", "生产退料", 1),
    /** 采购退货 */
    CGTH("CGTH", "", "采购退货", -1),

    SCHB("SCHB","","生产汇报",1),
    /** 生产入库 */
    SCRK("SCRK", "205", "生产入库", 1),

    PDDD("PDDD","205","盘点订单",1),
    LLJY("LLJY","205","来料检验",1),

    YCCL("YCCL","205","来料检验",1),

    TPTRAY("TPTRAY","205","托盘",1),
    IRON("IRON","205","合并后的托盘",1),
    MJJC("MJJC","205","模具检查",1),
    MJWX("MJWX","205","模具检查",1),
    MJBF("MJBF","205","模具检查",1),

    BFDB("BFDB","205","模具检查",1),

    GXHB("GXHB","205","工序汇报",1);

    /** 枚举值 */
    private final String _key;

    /** 二维码关键字 */
    private final String _barcodeKey;

    /** 名称 */
    private final String _label;

    /** 出入库标志位 */
    private final int _inventoryIO;

    /**
     * 初始化枚举值
     *
     * @param key 键值
     * @param barcodeKey 二维码关键字
     * @param label 名称
     * @param inventoryIO 出入库标志位
     */
    BillType(String key, String barcodeKey, String label, int inventoryIO) {
        this._key = key;
        this._barcodeKey = barcodeKey;
        this._label = label;
        this._inventoryIO = inventoryIO;
    }

    public static BillType getEnum(String key) {
        for (BillType ele : values()) {
            if(ele.toString().equals(key)) {
                return ele;
            }
        }
        return null;
    }

    /**
     * 重写toString
     *
     * @return 键值
     */
    public String toString() {
        return _key;
    }

    /**
     * 获取二维码关键字
     *
     * @return 二维码关键字
     */
    public String barcodeKey() {
        return _barcodeKey;
    }

    /**
     * 获取名称
     *
     * @return 名称
     */
    public String label() {
        return _label;
    }

    /**
     * 获取出入库标志位
     *
     * @return 出入库标志位
     */
    public int inventoryIO() {
        return _inventoryIO;
    }
}
